<template>
  <!-- 最外层容器，有一个默认宽度 270 px -->
  <div class="daai-card" :style="width ? { width: width + 'px' } : {}">
    <!-- 1.卡片图片 -->
    <div class="daai-card-img" :style="imgHeight ? { height: imgHeight + 'px' } : {}">
      <img :src="imgSrc" alt="img" />
    </div>
    <!-- 2.卡片描述 -->
    <div v-if="summary" class="daai-card-summary">
      {{ summary }}
    </div>
    <div v-else class="daai-card-summary">
      <slot></slot>
    </div>
    <div class="daai-card-footer" v-if="$slots.footer">
      <slot name="footer"></slot>
    </div>
  </div>
</template>

<script setup>
import propTypes from './props'
defineOptions({
  name: 'DaaiCard',
})
defineProps(propTypes)
</script>

<style lang="scss" scoped></style>
